package cn.eonshine.cuba.inf.modular.sys.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import cn.eonshine.base.core.node.MenuNode;
import cn.eonshine.base.core.node.ZTreeNode;
import cn.eonshine.cuba.inf.modular.sys.entity.Menu;

/**
 * <p>
  * 菜单表 Mapper 接口
 * </p>
 *
 * @author stylefeng
 * @since 2017-07-11
 */
public interface MenuMapper extends BaseMapper<Menu> {

	/**
	 * 根据条件查询菜单
	 * @param condition condition
	 * @param level menu level
	 * @return menu List
	 */
    List<Map<String, Object>> selectMenus(@Param("condition") String condition, @Param("level") String level);

    List<Long> getMenuIdsByRoleId(@Param("roleId") Integer roleId);

    List<ZTreeNode> menuTreeList();

    List<ZTreeNode> menuTreeListByMenuIds(List<Long> menuIds);

    int deleteRelationByMenu(Long menuId);

    List<String> getResUrlsByRoleId(Integer roleId);

    List<MenuNode> getMenusByRoleIds(List<Integer> roleIds);
}